package org.huawei260.TiKu.ODsuanfa;

/**
 * @Author: qingle
 * @Date: 2024/10/28-16:11
 * @Description: 3253 【固定滑窗】2023B-探索地块建立
 * @version: 1.0
 */
import java.util.Scanner;
public class B_2023B_3253__固定滑窗_探索地块建立 {

//	public class Main {
		public static void main(String[] args) {
			Scanner sc = new Scanner(System.in);

			int n = sc.nextInt();
			int m = sc.nextInt();
			int c = sc.nextInt();
			int k = sc.nextInt();

			int[][] matrix = new int[n][m];

			for (int i = 0; i < n; i++) {
				for (int j = 0; j < m; j++) {
					matrix[i][j] = sc.nextInt();
				}
			}

			System.out.println(getResult(matrix, n, m, c, k));
		}

		/**
		 * @param matrix n*m的地块
		 * @param n 地块行数
		 * @param m 地块列数
		 * @param c 正方形的发电站边长为c
		 * @param k 目标电量k
		 * @return 可以建设几个发电站
		 */
		public static int getResult(int[][] matrix, int n, int m, int c, int k) {
			int[][] preSum = new int[n + 1][m + 1];

			for (int i = 1; i <= n; i++) {
				for (int j = 1; j <= m; j++) {
					preSum[i][j] =
						preSum[i - 1][j] + preSum[i][j - 1] - preSum[i - 1][j - 1] + matrix[i - 1][j - 1];
				}
			}

			int ans = 0;

			for (int i = c; i <= n; i++) {
				for (int j = c; j <= m; j++) {
					int square = preSum[i][j] - (preSum[i - c][j] + preSum[i][j - c]) + preSum[i - c][j - c];
					if (square >= k) ans++;
				}
			}

			return ans;
		}
	}